class StrUtil {
    /**
     * 转驼峰
     * @param {string} str 字符串
     */
    toHump(str: string) {
        const spacers = ['-', '_'];
        return str.replace(new RegExp('[' + spacers.join('|') + '](\\w)', 'g'), (_, c) => c ? c.toUpperCase() : '');
    }
}

export default new StrUtil()
